#include <cstdio>
int main()
{//傻了
    int permutation[100001] = {0};
    int N;
    scanf("%d",&N);
    int i;
    int count = 0;
    for (i = 0; i < N; ++i)
    {
        scanf("%d", permutation + i);
        if (i != 0 && permutation[i] != i)
            ++count;
    }
    printf("%d\n", count);
    return 0;
}